package com.chushouya.manager.dto.admin.im;

import com.general.framework.core.lang.IdTakes;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@ApiModel("消息体")
@NoArgsConstructor
public class Content {

    /**
     * 业务ID
     */
    private String bizId;

    /**
     * 业务场景
     */
    private String bizScene;

    /**
     * 内容类型
     */
    private String type;

    /**
     * 消息内容
     */
    private String data;

    public Content(String bizId, String bizScene, String type, String data) {
        this.bizId = bizId;
        this.bizScene = bizScene;
        this.type = type;
        this.data = data;
    }

    public String getBizId() {
        return Objects.isNull(this.bizId) ? IdTakes.takeRandomCode(10) : this.bizId;
    }
}
